import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-04-18
 * Time: 23:25
 */

/**
 * 字符流:Reader
 * 一次读一个字符
 */

public class Demo6 {
    public static void main(String[] args) {
        try(Reader reader = new FileReader("d:/text.txt")){
           while(true){
               int c = reader.read();
               if(c==-1){
                   break;
               }
               char ch = (char) c;
               System.out.print(ch);
           }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
